﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace HML.Design
{
    /// <summary>
    /// ArcMeter控件设计模式行为
    /// </summary>
    public class ArcMeterDesigner : ControlDesigner
    {
        public override void InitializeNewComponent(IDictionary defaultValues)
        {
            base.InitializeNewComponent(defaultValues);

            ArcMeter meter = (ArcMeter)this.Component;
            MemberDescriptor items_member = (MemberDescriptor)TypeDescriptor.GetProperties((object)this.Component)["Items"];
            this.RaiseComponentChanging(items_member);
            meter.GradualArc.ColorItems.Add(new ArcMeterGradualColor() { Position = 0f, Color = Color.FromArgb(0, 231, 191) });
            meter.GradualArc.ColorItems.Add(new ArcMeterGradualColor() { Position = 0.5f, Color = Color.FromArgb(184, 247, 0) });
            meter.GradualArc.ColorItems.Add(new ArcMeterGradualColor() { Position = 1f, Color = Color.FromArgb(254, 36, 0) });
            meter.GradualArc.Visible = true;
            meter.Mark.MinorAmount = 5;
            meter.Mark.MainTextDistance = 10;
            this.RaiseComponentChanged(items_member, (object)null, (object)null);
        }

    }

}
